package com.kysd.base;

/**
 * base controller
 * @author liangjinquan
 *
 */
public abstract class BaseController {
	
	protected int SUCCESS = 0;
	private int FAIL = -1;

	@SuppressWarnings("rawtypes")
	public ApiModel SUCCESS(){
		return SUCCESS(null);
	}
	
	@SuppressWarnings("all")
	public ApiModel SUCCESS(Object body) {
		return SUCCESS(SUCCESS, "操作成功", body);
	}
	
	@SuppressWarnings("all")
	public ApiModel SUCCESS(Integer status, String errorMsg, Object body) {
		return new ApiModel(SUCCESS, "操作成功", body);
	}
	
	@SuppressWarnings("all")
	public ApiModel FAIL() {
		return FAIL(FAIL, "操作失败", null);
	}
	
	@SuppressWarnings("all")
	public ApiModel FAIL(Object body) {
		return FAIL(FAIL, "操作失败", body);
	}
	
	@SuppressWarnings("all")
	public ApiModel FAIL(Integer status, String errorMsg, Object body) {
		return new ApiModel(FAIL, "操作失败", body);
	}
}
